<?php
abstract class ParamHandler{
	protected $source;
	protected $params = array();

	function __construct($source){
		$this->source = $source;
	}

	public function addParam($key,$val)
	{
		$this->params[$key] = $val; 
	}

	public function getAllParams(){
		return $this->params;
	}

	static function getInstance($filename){
		if(preg_match("/\.xml$/i",$filename)){
			return new XmlParamHandler($filename);
		}
		return new TextParamHandler($filename);
	}

	abstract function write();
	abstract function read();
	
}